<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPE html>
<!--[if IE 6 ]> <html class="ie6 lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 6 ]> <html class="lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 7 ]> <html class="lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 8 ]> <html class="lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 9 ]> <html class="lte_ie9"> <![endif]-->
<!--[if (gte IE 10)|!(IE)]><!--><html><!--<![endif]-->
<head>
    <title>传阅情况</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="../css/notice/style.css" />
    <script type="text/javascript" src="../js/news/jquery-1.9.1.js"></script>
    <script src="../js/news/page.js"></script>
    <script src="../lib/laydate/laydate.js"></script>
    <script src="../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        html{
            height:100%;
            overflow: auto;
        }
    </style>
</head>

<body class="bodycolor">
<form name="form1" method="post" >
    <table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
        <tr>
            <td class="Big" style="margin-left: 10px;"><img src="../img/chayue.png" align="absmiddle" style="vertical-align: middle;margin-top: -5px;"><span class="big3"><fmt:message code="news.th.querysituation" /></span>
            </td>
        </tr>
    </table>

    <table class="TableTop" width="100%" align="center">
        <tr>
            <td class="left"></td>
            <td class="center tid"><fmt:message code="vote.th.TestQuery" /></td>
            <td class="right"></td>
        </tr>
    </table>
    <table class="TableBlock" width="100%" align="center">

    </table>

</form>


</body>
<script>
    $(function(){
        /*查询某条传阅数据的接口*/
        var runId=$.getQueryString("runId");
        var prcsId =$.getQueryString("prcsId");
        var flowPrcs =$.getQueryString("flowPrcs");
        $.ajax({
            url: '/ToBeReadController/queryFileIsRead',
            type: 'get',
            data: {
                runId: runId,
                prcsId:prcsId
            },
            dataType: 'json',
            success: function (obj) {
                var data = obj.data;
                var title = '';
                if(data.length > 0){
                    title = '<tr><td class="TableContent" align="right" colspan="3">流程名称：<u style="cursor:hand" class="userName">'+ data[0].runName +'</u>&nbsp;&nbsp;流程创建时间：'+ data[0].createDate +'</td></tr><tr class="TableHeader"><td nowrap="" align="center" style="width:50%">已读人员</td><td nowrap="" align="center">未读人员</td></tr><tr class="TableData"><td class="read" style=""></td><td class="toread" style=""></td></tr>'
                    $('.TableBlock').html(title);
                    $('.tid').html(data[0].runName);
                    var toread = '';
                    var read = '';
                    for(var i=0;i<data.length;i++){
                        if(data[i].readFlag == 0){
                            toread+=data[i].userName+',';
                        }else{
                            read+='<div>'+data[i].userName+'<span style="float:right">已读时间：'+data[i].readDate+'</span></div>';
                        }
                    }
                    // console.log(toread)
                    $('.toread').html(toread.substr(0,toread.length-1));
                    $('.read').html(read);
                }

            }
        })

    })


</script>
</html>
